package com.whccb.apps.office.document;

import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.server.bind.annotation.Controller;
import com.actionsoft.bpms.server.bind.annotation.Mapping;
import com.whccb.apps.office.document.web.ODWeb;

@Controller
public class ODController {
	
	/**
	 * 发文管理-》》发文拟稿，新增发文，点击发文拟稿，弹出页面前查询数据
	 * @param sid
	 * @param deptid
	 * @return
	 */
	@Mapping(value = "com.whccb.apps.office.document_getOfficeDocumentRecordType")
	public String getOfficeDocumentRecordType(String sid, String deptid) {
		ODWeb web = new ODWeb();
		return web.getOfficeDocumentRecordType(sid, deptid);
	}
	/**
	 * 公文表单
	 * @param me
	 * @param processId
	 * @param title
	 * @param createUserLocation
	 * @param typeId
	 * @return
	 */
	@Mapping("com.whccb.apps.office.document.gw_open_fw_form")
	public String openFwForm(UserContext me, String processId, String title,
			String createUserLocation, String typeId) {
		ODWeb web = new ODWeb(me);
		return web.openFwForm(processId, title, createUserLocation, typeId);
	}

	@Mapping("com.whccb.apps.office.document.modify_file_num")
	public String modifyOfficeDocumentFileNum(UserContext me, String bindid,
			String boName, String recordTypeId, String year, String flag,
			String fileNum) {
		ODWeb web = new ODWeb(me);
		return web.modifyOfficeDocumentFileNum(bindid, boName, recordTypeId,
				year, flag, fileNum);
	}

	@Mapping("com.whccb.apps.office.document.modify_file_type")
	public String modifyOfficeDocumentFileType(UserContext me, String bindid,
			String boName, String recordTypeId, String recordTypeName) {
		ODWeb web = new ODWeb(me);
		return web.modifyOfficeDocumentFileType(bindid, boName, recordTypeId,
				recordTypeName);
	}

	/**
	 * cms中gw的url访问表单
	 * 
	 * @param me
	 * @param processInstId
	 * @return
	 */
	@Mapping("com.whccb.apps.office.document.gw_cms_page")
	public String gwCmsPage(UserContext me, String processInstId,
			String taskInstId, String formDefId) {
		ODWeb web = new ODWeb(me);
		return web.gwCmsPage(processInstId, taskInstId, formDefId);
	}

	/**
	 * 体系文件预览
	 * @param me
	 * @param modelid
	 * @return
	 */
	@Mapping("com.whccb.apps.office.document.check_download_zw_permi")
	public String checkDownLoadCmsZwPermi(UserContext me, String modelid) {
		ODWeb web = new ODWeb(me);
		return web.checkDownLoadCmsZwPermi(modelid);
	}

	@Mapping(value = "com.whccb.apps.office.document.sw_addsubpro")
	public String addsub(String sid, String parentProcessinstid,
			String parentTaskDefid, String useridstr) {
		ODWeb web = new ODWeb();
		return web.addsub(sid, parentProcessinstid, parentTaskDefid, useridstr);
	}

	@Mapping(value = "com.whccb.apps.office.document.sw_delsubpro")
	public String delsub(String sid, String parentProcessinstid,
			String parentTaskDefid, String useridstr) {
		ODWeb web = new ODWeb();
		return web.delsub(sid, parentProcessinstid, parentTaskDefid, useridstr);
	}

	@Mapping(value = "com.whccb.apps.office.document.get_print_url")
	public String getPubPrintPageURL(String sid, String boname, String boid) {
		ODWeb web = new ODWeb();
		return web.getPubPrintPageURL(sid, boname, boid);
	}

	@Mapping(value = "com.whccb.apps.office.document_backprocess_task")
	public String backProcessTask(String sid, String reason, String boName,
			String bindid, String pointTaskDefid) {
		ODWeb web = new ODWeb();
		return web.backProcessTask(sid, reason, boName, bindid, pointTaskDefid);
	}

	@Mapping(value = "com.whccb.apps.office.document_to_leaderoption_task")
	public String toLeaderOptionTask(String sid, String reason, String boName,
			String bindid, String pointTaskDefid) {
		ODWeb web = new ODWeb();
		return web.toLeaderOptionTask(sid, reason, boName, bindid,
				pointTaskDefid);
	}

}
